package uk.ac.bath.util;

public class Resolver {
    public static Object resolve(String name) {
        Object o=null;
        try {
            o = Class.forName(name).newInstance();
        } catch (ClassNotFoundException e) {
            System.err.println(" YIKES INVALID CLASS "+e.getMessage());
            System.exit(1);
        } catch (InstantiationException e) {
            System.err.println(" YIKES COULD NOT CREATE OPERATOR "+e.getMessage());
            System.exit(1);
        } catch (IllegalAccessException e) {
            System.err.println(" YIKES ILLEGAL ACCCESS "+e.getMessage());
            System.exit(1);
        }

        return o;

    }
}
